home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9206.ARJ
/
1006018A
< prev
next >
Wrap
Text File
|
1992-06-02
|
352b
|
17 lines
/* calloc function */
#include <stdlib.h>
#include <string.h>
void *(calloc)(size_t nelem, size_t size)
{ /* allocate a data object on the heap and clear it
*/
const size_t n = nelem * size;
char *p = (char *)malloc(n);
if (p)
memset(p, '\0', n);
return (p);
}